﻿using System;
namespace XmlSockets.Internal
{
    internal struct XmlSocketSendContent:IXmlSocketSendContent
    {

        private byte[] _buffer;

        internal XmlSocketSendContent(byte[] buffer,long Position)
        {
            this._buffer = new byte[Position];
            Array.ConstrainedCopy(buffer, 0, this._buffer, 0, (int)Position);

        }

        internal static IXmlSocketSendContent Create(byte[] buffer,long postion){ return new XmlSocketSendContent( buffer, postion); }



        public byte[] Buffer
        {
            get
            {
                return _buffer;
            }
        }
    }
}
